<?php get_header(); ?>
          <?php get_sidebar(); ?>
          <div id="capabilities">
				<?php $dict = get_param("dict", 0);?>
				<?php if ($dict != 0) : 
					$word = get_param("word", "");
					error_reporting(E_ALL);
					ini_set('display_errors', '0');
					if ($word) {						
						$homepage = file_get_contents("http://vdict.com/gateway.php?co=&dict=$dict&word=$word");
						
						preg_match_all("/<table[^>]*>(.+?)<\/table>/is", $homepage, $matches);
						
						$pronun = isset($matches[1][3]) ? $matches[1][3] : '';
						$dictcontent = isset($matches[1][4]) ? $matches[1][4] : 'Không tìm thấy từ ' . $word;
						echo '<div class="post clearfix">';
						echo '<h2 class="title" style="margin-top: 10px">Tra từ điển: ' . $word . '</h2>';
						echo '<div class="entry">';
						//var_dump($dictcontent);
						echo '<table id="dictionary">';
						echo $pronun;
						echo $dictcontent;
						echo '</table>';
						echo '</table>';
						echo '</div>';
						echo '</div>';
					} ?>
				<?php else : ?>
					<?php if ( ! dynamic_sidebar( 'slider_banner' ) ) {} ?>
					<?php include_once(TEMPLATEPATH . '/topbanner.php'); ?>
					<?php $p2 = get_post($pid2=69); setup_postdata($p2); ?>
					<div class="post clearfix" id="post-<?php the_ID(); ?>">
							<h2 class="title" style="text-transform:uppercase"><?php echo $p2->post_title; ?></h2>
						<div class="entry">
							<?php the_content(); ?>
						</div>
					</div>
				<?php endif; ?>
				<div style="clear:both"></div>
          </div><!-- end capabilities -->
<?php get_footer(); ?>
